<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class DeviceViewForm extends MiniyunViewForm
{

    public function attributeDeviceHeader()
    {
        return array(
        	'$id'              => '设备ID',
        	'user_device_name' => '设备名称',
        	'updated_at'       => '修改时间',
        );
    }
    
    public function attributeFilterActions(){
        return array(
            'search'=>array(
              "condition"=>"select id from ".Yii::app()->params['tablePrefix']."users where user_name like '%?%') or id in(select user_id from ".Yii::app()->params['tablePrefix']."user_metas where meta_key in('nick','email','phone') and meta_value like '%?%'"
        ),
             'is_admin'=>array(
              "condition"=>"select user_id from ".Yii::app()->params['tablePrefix']."user_metas where meta_key='is_admin' and meta_value='1'"
        ),
              'disabled'=>array(
              "condition"=>"select id from ".Yii::app()->params['tablePrefix']."users where user_status=0"
        ),
        );
    }
    
    public function attributeItemNextActions(){
        return array(
            '删除'=>Yii::app()->createUrl("adminUserPanel/update&action=edit"),        );
    }
}
